on 06-21-2007 11:12 AM
Hi all
I have a DropDown By Key UI element bound to Value Attribute of type String.
I want to change Lead Selection element later on when user changes the other dropdowns.
Please tell me how to set Lead element in drop down by Key ?
Make the cardinality of the node to which you are binfding the dropdown to 1....n .. and witnin the code collect all the values within a List( java.util) and map that list to currentcontext element of the node to which you r mapping your drp down.. Populate values in a list and bound that list like the followng wcContext.current<node>element.bind(List);
It will surely work.
Thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
Well thats right.What I am saying is that you cannot modify the model attribute properties which is not allowed by the Framework.The reason for which is obvious.Take an example of a SOAP webservice imported as a Model in this case.
Now if you are aware with the WD phase model the data from the request is copied into the data container initially in a client-protocol independent form.
From there it is parsed and populated into the context.Here imagine changing the context attribute cardinality or type and you can see that the request will never go beyond the validation phase which occurs subsquently.
Framework takes care of this for us by not allowing to change the properties.
Regards
Amit
Hi Amit
Thanks a lot for ur answer.
My requirement is like this:
One dropdown will have Vendor Numbers.
Other will have its business status values A,B,C, D.
If some vendor is selected its corresponding business status should be leadselection element in 2nd dropdown.
If some vendor dont have business status among these values, 2nd drop down should be blank as lead selection and A,B,C,D as remaing values, so that the user can change its business status and save it.
I am able to select the A,B,C, or D as lead selection element ,
but not when it is blank.
Please suggest the solution:
strange.. you would have obviously used the event to trigger the lead selection.
Ok...there's an alternative to this:
create a boolean attribute and set a condition in the wdDoModifyView().Now get the DDBI element object and set the selected value explicitly to in that particular case (i.e empty string) through the UI element object.
I hope this should work.
Regards
Amit
Hai vinod ,
simply create a node as like output model node, after executing the model, simply copy the elements from model node your duplicate node using wdcopyservice.
WDCopyService.copyElements(modelnode, dupnode).
bind duplicate node to dd. change cardinality to 1..n.
this may solve your problem.
Regards,
Naga
Hi,
What i propose is you use DropDownByKey for bussines status.
When you populate your DropDownByKey for bussiness staus using valueset,
before starting the for loop set a key valu pair for default value.
valueSet.put("Default","Choose bussiness status"); // if you want you can set the value null.
// start you for loop
When ever you select a vendor name a event is triggered.
In that event you get the bussines status code for that vendor.
Now loop through the Node for bussiness stauts and compare the key value of the business status with
the status of the vendor selected anf if they match set that as the value of the node.
Consider
Business stautus drop down visible values
Choose bussiness status
A
B
C
D
Bussiness status of the vendor selected is "B" and set in the context attribute say VendorBusinessStatus
for(i=0;i<nodeBussinessStatus.size;i++)
{
if(wdContext.currentBussinessStatus.elementAt(i).getStatus()==wdContext.currentContextElement.getVendorBusinessStatus)
{
wdContext.currentBussinessStatus.setStatus(wdContext.currentContextElement.getVendorBusinessStatus);
break;
}
else
{
wdContext.currentBussinessStatus.setStatus("Default");
}
}
Hi,
Assuming the context to be as below
<b>Context
--BusinessStatus (node)
-
StatusCode (attribute) // this will have the code of the status
-
StatusDescription (attribute) // this attribute should be mapped to the selectedKey property of the DDBK.</b>
If you have mapped you context from component controller to view context then
create a method in Component Controller say populateStatus and write the below code in that method
call this method in your view's wdDoinit();
IWDAttributeInfo atrInfo = wdContext.nodeBusinessStatus().getNodeInfo().getAttribute("StatusDescription");
IModifiableSimpleValueSet ValueSet = atrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
ValueSet.put("Default","Select status");
for(int i = 0; i < wdContext.nodeBusinessStatus.size();i++)
{
ValueSet.put(wdContext.nodeBusinessStatus().getBusinessStatusElementAt(i).getStatusCode(), wdContext.nodeBusinessStatus().getBusinessStatusElementAt(i).getStatusDescription());
}
While saving this selected status for vendor get the status code as below.
wdContext.currentBusinessStatusElement.getLeadSelection();
This will give you the StatusCode and not the Status Description that is displayed in the DropDownByKey.
If this does not help you then paste your context structure here we will help you.
Thanks to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vinod,
Well what Shriram suggested itself is completely wrong and makes no sense in the scenario you stated.
Let me put it this way if there is something like a DDByKey then you'll nessecarily be requiring to create a dictionary simple type without which you will not be able to
bind the UI element.
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can't do it automatically with a dropdownbykey. If you want it, two solutions :
- 1 - On the onAction of the UI element, just change the lead.
- 2 - Use the dropdownbyindex, and like this the lead selection will move when the user select something.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
The attribute to which you've bound the DDBKEY element holds the key and displays the value at runtime.In your case you'll require to set the attribute to some default key that you want as the leadSelection and so the lead selection
can be changed by manipulating the same attribute keys.
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.