having modify and commit tag in one page

X-Application Version: 3.1.3
Tamino Version : 3.1.1
Platform : Win2k
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
hi
I have a page that displays some info from tamino . I have yes and no buttons in this page .when I press yes I want a flag set to 1 and when I presss no I want it to be 0 .
how should I implement the case ?
(in fact I want that modify and commint happens in one page .)
my page is like this :
-------------------------------------------
id =…
name=…
pass=…

yes no
-------------------------------------------

my doc in db :
id
name
pass
flag

Hello,

I am not sure whether I understand your idea correctly:

The only reason for adding this flag to your documents is to implement a functionality for your JSPs.

I would not do that. I would not mix the application data with data for controlling the user interface.

Therefore my question: What is your problem with the modify and commit on one page?

Do you know the tag ‘directcommand’. It allows you to sent for instance a ‘modify’ for a document when the page is evaluated.

An example:

<xapp:form>
  <xapp:directcommand type="modify" ... />
  ...
  <xapp:action type="commit" ...>...</xapp:action>
  ...
</xapp:form>



Does the directcommand solve your problem?

Bye,
Christian.

hi
I did that you said.but it is not update myfield or it had internal error:
my page is:
------------------------------
xapp:module

xapp:form


<xapp:directcommand type=“modify” />

























 









درخواست بليت
خروج

 












فرم
درخواست بليت
هواپيما
















































به قسمت
خدمات
  تاريخ
درخواست

<xapp:display select=“/request/request-date”/>




خواهشمند
است در مورد
خريد بليت
هواپيما به
شرح ذيل  
اقدام فرماييد
  بشماره 
پرسنلي
<xapp:display select=“/request/personnel-id”/>
  بنام 
<xapp:display select=“/request/personnel-name” />


  جهت پروژه 
<xapp:display select=“/request/project-code” />






















اولويت
1
رفت
از 
<xapp:display select=“/request/priority-1/go1/departure11” />
به
<xapp:display select=“/request/priority-1/go1/destination11” />
روز
<xapp:display select=“/request/priority-1/go1/day11” />
تاريخ
<xapp:display select=“/request/priority-1/go1/date11” />

<xapp:display select=“/request/priority-1/go1/time11” />
برگشت
از
<xapp:display select=“/request/priority-1/return1/departure12” />
به
<xapp:display select=“/request/priority-1/return1/destination12” />
روز
<xapp:display select=“/request/priority-1/return1/day12” />
تاريخ
<xapp:display select=“/request/priority-1/return1/date12” />
 
<xapp:display select=“/request/priority-1/return1/time12” />
شب


 






















اولويت
2
رفت
از
<xapp:display select=“/request/priority-2/go2/departure21” />
به
<xapp:display select=“/request/priority-2/go2/destination21” />
روز
<xapp:display select=“/request/priority-2/go2/day21” />
تاريخ
<xapp:display select=“/request/priority-2/go2/date21” />

<xapp:display select=“/request/priority-2/go2/time21” />
شب
برگشت
از
<xapp:display select=“/request/priority-2/return2/departure22” />
به
<xapp:display select=“/request/priority-2/return2/destination22” />
روز
<xapp:display select=“/request/priority-2/return2/day22” />
تاريخ
<xapp:display select=“/request/priority-2/return2/date22” />
 
<xapp:display select=“/request/priority-2/return2/time22” />
شب


 

<!----------------------------------------------
I want the falg is update .but not work!
<!------------------------------------------------
<xapp:edit select=“/request/flag” >

</xapp:edit>

<xapp:action type=“commit” form=“form1”>

</xapp:action>






</xapp:form>

</xapp:module>

Hello,

could you sent me the error that occurs if you have inserted the directcommand of type ‘modify’.

Does this error occur

(A) when you load the page (its content is not displayed but an exception is returned) or

(B) when you press the submit button of the page.

Furthermore, you don’t have any xapp:edit tag on your page. There is no input field which could accept new values (except your hidden input parameter for /request/flag.

What do you expect should be updated if you check your document after pressing the commit button?

Bye,
Christian.

Bye,
Christian.

hi
I want the update element flag when the page is submit .the flag is update with “2”
I used the tag directcommand with type modify but it did not work! ( another type of directcommand worked but modify did not work!)

thanks alot

Hello,

the modify command does nothing else then setting the status of a document from READ to MODIFIABLE. Once a document is MODIFIABLE it is allowed to offer xapp:edit tag for changing the content of document’s elements.

Therefore, the modify command is necessary if you don’t have a former link to your page sending the modify command.

Regarding your problem with updating of the ‘flag’ element:

(1) Could you change your page by using

<xapp:edit select=“/request/flag” >
</xapp:edit>

instead of a hidden input tag?

(2) Invoke your page. It should show you an input field.

Does it display “007”?

(3) Replace 007 by new value, e.g. 1234

(4) Press the commit button.

(5) Check your database for a document with /request[flag=‘1234’]. You can do this via browser

http://<your tamino url>/<your collection>?_xql=/request[flag='1234']
</pre><BR><BR>Example:<BR><pre class="ip-ubbcode-code-pre">
http://sunwt/tamino/myDB/myCollection?_xql=/request[flag='1234']



Does this work?

Bye,
Christian.