on 09-26-2008 6:25 AM
Hi @,
In my application I have a table with checkbox and user has to select the checkbox. The details
of the checked rows in table is passed to backend for updation.
But I have observed tht unless the first record in the table is selected the records are
not getting passed to backend I am looping the table node based upon its size and
checked state of checkbox as true and then populating the table to be passed to backend.
Dont know why this strange behaviour is happening.
Regards,
Hi,
Lead Selection of your table might be on the first record, please check this
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I tried by changing the lead selction also but again it worked like this.
But when I am selecting the first record and then processing it its working fine.
I am using following code to decide the selected checkbox rows :
for (int i = 0; i < wdContext.nodeVendor_Multi().size()
&& wdContext.nodeVendor_Multi().getVendor_MultiElementAt(i)
.getSELECTFLG() == true; i++) {
rfctable = new Zvendordtls();
rfctable.setDeliverymethod(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getDELMETHOD());
rfctable.setHsbcpaymethod(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getHSBCPAYMMETHOD());
rfctable.setLifnr(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getACCNUM());
inp.addZvendorrcrd(rfctable);
}
And this data is passed to RFC
Regards,
Edited by: BeyondThe obvious on Sep 26, 2008 7:53 AM
Hi,
With a slight change in your code
for (int i = 0; i < wdContext.nodeVendor_Multi().size(); i++)
{
I<VendorNodeElement> element = wdContext.nodeVendor_Multi().getVendor_MultiElementAt(i);
if( element.getSELECTFLG()) // I guess this is your attribute which stores the checked state
{
rfctable = new Zvendordtls();
rfctable.setDeliverymethod(element.getDELMETHOD());
rfctable.setHsbcpaymethod(element.getHSBCPAYMMETHOD());
rfctable.setLifnr(element.getACCNUM());
inp.addZvendorrcrd(rfctable);
}
}
Hi,
use this,
for (int i = 0; i < wdContext.nodeVendor_Multi().size() ; i++) {
if(wdContext.nodeVendorMulti().getVendor_MultiElementAt(i).getSELECTFLG() == true){_
rfctable = new Zvendordtls();
rfctable.setDeliverymethod(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getDELMETHOD());
rfctable.setHsbcpaymethod(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getHSBCPAYMMETHOD());
rfctable.setLifnr(wdContext.nodeVendor_Multi()
.getVendor_MultiElementAt(i).getACCNUM());
inp.addZvendorrcrd(rfctable);
}
}
Regards,
ramesh
Hello,
Your code on action button looks fine, there might be any problem with the initialization. Would you paste that table initialization code?
Few Java Tips:
You don't have to compare any boolean value with a true or false, when using them in any conditional statement.
boolean flag = true;
if (flag == true)
// is as same as this
if (flag)
Also whether you write
for (int i=0; i < 5 && flag; i++)
//this works same as:
for (int i=0; i<5; i++)
{
if (flag)
}
//unless you don't have any thing to do before if statement
Regards,
Jawed Ali
Hi,
post the code,
you reading the checkbox value ?
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
on click of check box try to fill/create one Node with the selected check box row values.
And use this node for further updation in place of using table Node.
I have done this for delete of rows from the DBase after clicking the checkbox---
in domodify view:- use this code
IWDCheckBox cb = (IWDCheckBox) view.getElement("Checkbox1_0_0_editor");
cb.mappingOfOnToggle().addSourceMapping("checked", "checked");
create check box action with boolean parameter
public void onActiononaddcheck(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, boolean checked )
{
IPrivateAssignAssociatesView.IVn_DeleteNodeElement ele1;
boolean flag = false;
if (checked) {
ele1 = wdContext.nodeVn_DeleteNode().createVn_DeleteNodeElement();
ele1.setVa_AssName(wdContext.currentVn_AssoDetailsElement().getVa_AssName());
wdContext.nodeVn_DeleteNode().addElement(ele1);
} else {
IWDNodeElement ele2 =wdContext.nodeVn_AssoDetails().getElementAt(wdContext.nodeVn_AssoDetails().getLeadSelection());
for (int i = 0; i < wdContext.nodeVn_DeleteNode().size(); i++) {
try {
if (!ele2.getAttributeValue("va_AssName").equals(null)
&& !(wdContext.nodeVn_DeleteNode() .getElementAt(i) .getAttributeValue("va_AssName")
.equals(null))) {
flag =wdContext.nodeVn_DeleteNode() .getElementAt(i) .getAttributeValue("va_AssName")
equals(ele2.getAttributeValue("va_AssName"));
}
} catch (Exception e) {
flag = true; }
if (flag)
wdContext.nodeVn_DeleteNode().removeElement(
wdContext.nodeVn_DeleteNode().getElementAt(i));
}
}
}
after that you can manipulate the DeleteNode.
Hoe this may help you.
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
would you mind pasting your source code here?
Also try:
Instead of iterating the table rows; loop through the context attribute node that is mapped with the table. I have done this, for delete selected rows.
Edited by: Jawed Ali on Sep 26, 2008 10:47 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.