1
votes

I defined a document datasource(called document1) in a panel in my extlib dialog box. Within this panel, it contains dialog content and dialog butotn bar. Within the dialog content, in contains a custom control that has all the components likes dojo edit box, list box, radio butotn etc. Within the dialog button bar, it contains a Save button. On save, I could not get the value from any component by the following getComponent, document.getDocument.getxxx:

 print (getComponent.getValue("control"));
 print (document1.getDocument(true).getValueInString("control"));
 print (document1.getValue("control"));

Interesting to do know that document1.sertValue("control", newvalue) and document1.getDocument(true).isNewNote() are all working.

The dialog box is opened from a view column in the repeat. All data are shown in dialog box corerctly. I could save the modified data, retrieve them and display them with no issue. The only thing that i could not get their values for processing.

The Save event handler is full update with set partial execution mode for the panel

panel is ignore its parameter and set scope to request but no luck.

Your help is really appreciated. Thanks in advance.

1
Actually document1.getDocument().getXXX('name of the item') and document1.getValue("name of the item") their parameter shoud be name of the item, not contorl id !!! They are workable :-). However, still no luck in getComponent.getValue("control").Dragon Chow
shouldn't "print (getComponent.getValue("control"));" be "print (getComponent("control").getValue();" instead?Frantisek Kossuth
Ah, you're right, Frantisek. It's getComponent("control").getValue() :-)Per Henrik Lausten
Sorry I mistyed it. I actually did getComponent('controlId').getValue() and try again but still no luck. Just wonder that is it because of control in extlib dialog box.Dragon Chow
I just found that getComponent('controlId').getValue() is not working for extlib control, that is <xe:djTextBox>Dragon Chow

1 Answers

1
votes

There are a number of things you need to consider and/or check:

  • make sure you actually got hands on that control. Since it is inside a custom control you easily could have more than one of them. In this case you either need your own function getComponentChild(parentName,controlName) or (IMHO better) you read it from the compositeData of the customControl (which is a MAP)
  • when you bind a control, it is esier to go after its binding than to use getValue(). So when you bind to document.subject, look for that value (or viewScope.someValue if you bound it to the viewScope)
  • if validation fails in the submission or you query at an earlier phase, you can't use getValue() but need to use getSubmittedValue() since that contains the raw value before validation happened

Let us know how it goes